package fr.lelouet.tools;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;

/**
 * strategy to iterate several times on a collection of elements.<br />
 * The difference with a standard iterator is that the iterations are done
 * according to the iterations already done. eg, this may change the collection
 * it iterates over each time it is required to {@link #startNewLoop(Set) start
 * another loop}.
 * 
 * @param <T>
 *            the type to iterate on
 */
public interface SequentialIterator<T> extends Iterator<T>, Configurable {

	/**
	 * to call when we want to start a new loop
	 * 
	 * @param requests
	 *            the set of elements we want to iterate over.<br />
	 *            Please note that this does not mean to actually iterate over
	 *            that set, so some implementations may accept null. However,
	 *            this behavior should be documented.
	 */
	public void startNewLoop(Collection<T> requests);

}
